<template>
  <div class="container-content programme">
    <el-card shadow="never">
      <el-form
        ref="formRef"
        :model="formObject"
        label-width="110px"
        label-position="left"
        class="programme-form"
      >
        <el-form-item label="组织名称">
          <el-input></el-input>
        </el-form-item>
        <el-form-item label="部门名称">
          <el-input></el-input>
        </el-form-item>
        <el-form-item label="项目名称">
          <el-input></el-input>
        </el-form-item>
        <el-form-item label="项目编码">
          <el-input></el-input>
        </el-form-item>
        <el-form-item label="客户名称">
          <el-input></el-input>
        </el-form-item>
        <el-form-item label="需求名称">
          <el-input></el-input>
        </el-form-item>
        <el-form-item label="竞争对手名称">
          <el-input v-model="formObject.competitorsName"></el-input>
        </el-form-item>
        <el-form-item label="竞争对手联系人">
          <el-input v-model="formObject.competitorsUser"></el-input>
        </el-form-item>
        <el-form-item label="联系人电话">
          <el-input v-model="formObject.competitorsTel"></el-input>
        </el-form-item>
        <el-form-item label="	竞争能力">
          <el-input v-model="formObject.ability"></el-input>
        </el-form-item>
        <el-form-item label="竞争对手优势">
          <el-input v-model="formObject.advantage"></el-input>
        </el-form-item>
        <el-form-item label="竞争对手劣势">
          <el-input v-model="formObject.disAdvantage"></el-input>
        </el-form-item>
        <el-form-item label="备注">
          <el-input v-model="formObject.remarks" type="textarea"></el-input>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>
<script>
import { addComList, editComList, getDetailComList } from "@/api/system/survey";
export default {
  props: ["id"],
  data() {
    return {
      formObject: {
        ability: "",
        advantage: "",
        changeTime: "",
        competitorsName: "",
        competitorsTel: "",
        competitorsUser: "",
        createBy: "",
        createTime: "",
        customerId: "",
        disAdvantage: "",
        id: "",

        params: {},
        remark: "",
        remarks: "",
        searchValue: "",
        surveyProgrammeId: "",
        updateBy: "",
        updateTime: "",
      },
    };
  },
  methods: {
    onSubmit() {
      if (this.id) {
        editComList(this.formObject).then((res) => {
          if (res.code === 200) {
            this.$message({
              message: "修改成功！",
              type: "success",
            });
          }
        });
      } else {
        addComList(this.formObject).then((res) => {
          if (res.code === 200) {
            this.$message({
              message: "新增成功！",
              type: "success",
            });
          }
        });
      }
    },
    getData(id) {
      getDetailComList(id).then((res) => {
        if (res.code === 200) {
          this.formObject = res.data;
        }
      });
    },
  },
  created() {
    if (this.id) {
      this.getData(this.id);
    }
  },
};
</script>
<style lang="scss" scoped></style>
